<?php

class UserController extends CustomControllerAction {

	public function init() {
		parent::init();
	}

	public function browseAction() { }

	# infoAction: Handles displaying of information about a particular user
	public function infoAction() {
		
		# Get provided username
		$username = $this->getRequest()->getParam('username');

		# Get the user's attributes 
		$user_obj = new UserSDBManager();
		$user_obj_result = $user_obj->getByFieldValue('username', $username);
		$id = $user_obj_result[0]->getId();
		$info = $user_obj_result[0]->getAttributes();
		$info['user_id'] = $id;

		# Send the info to the view
		$this->view->info = $info;
	}
}

